-- 创建集输管道压力检测数据记录表
CREATE TABLE PipelinePressureData (
    ID INT AUTO_INCREMENT PRIMARY KEY,
    RecordTime TIMESTAMP,
    PipelineSection VARCHAR(50),
    Pressure_Value DECIMAL(5, 2),
    Pressure_Threshold DECIMAL(5, 2),
    AlarmStatus INT,
    SensorID VARCHAR(50),
    CalibrationDate DATE
);

-- 插入示例数据
INSERT INTO PipelinePressureData (RecordTime, PipelineSection, Pressure_Value, Pressure_Threshold, AlarmStatus, SensorID, CalibrationDate)
VALUES
-- 数据记录1
('2024-11-01 08:00:00', 'Section-A01', 2.34, 8.00, CASE WHEN 2.34 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录2
('2024-11-01 08:15:00', 'Section-A01', 5.67, 8.00, CASE WHEN 5.67 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录3
('2024-11-01 08:30:00', 'Section-A01', 9.12, 8.00, CASE WHEN 9.12 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录4
('2024-11-01 08:45:00', 'Section-A01', 3.89, 8.00, CASE WHEN 3.89 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录5
('2024-11-01 09:00:00', 'Section-A01', 6.21, 8.00, CASE WHEN 6.21 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录6
('2024-11-01 09:15:00', 'Section-A01', 10.56, 8.00, CASE WHEN 10.56 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录7
('2024-11-01 09:30:00', 'Section-A01', 4.78, 8.00, CASE WHEN 4.78 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录8
('2024-11-01 09:45:00', 'Section-A01', 7.32, 8.00, CASE WHEN 7.32 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录9
('2024-11-01 10:00:00', 'Section-A01', 1.98, 8.00, CASE WHEN 1.98 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录10
('2024-11-01 10:15:00', 'Section-A01', 8.91, 8.00, CASE WHEN 8.91 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录11
('2024-11-01 10:30:00', 'Section-A01', 11.23, 8.00, CASE WHEN 11.23 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录12
('2024-11-01 10:45:00', 'Section-A01', 6.74, 8.00, CASE WHEN 6.74 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 数据记录13
('2024-11-01 11:00:00', 'Section-A01', 3.45, 8.00, CASE WHEN 3.45 >= 8.00 THEN 1 ELSE 0 END, 'PressureSensor-001', '2024-10-15'),
-- 为另一个管道段插入数据
-- 数据记录14
('2024-11-01 11:15:00', 'Section-B02', 4.56, 6.00, CASE WHEN 4.56 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录15
('2024-11-01 11:30:00', 'Section-B02', 7.89, 6.00, CASE WHEN 7.89 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录16
('2024-11-01 11:45:00', 'Section-B02', 2.12, 6.00, CASE WHEN 2.12 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录17
('2024-11-01 12:00:00', 'Section-B02', 9.34, 6.00, CASE WHEN 9.34 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录18
('2024-11-01 12:15:00', 'Section-B02', 5.67, 6.00, CASE WHEN 5.67 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录19
('2024-11-01 12:30:00', 'Section-B02', 8.12, 6.00, CASE WHEN 8.12 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录20
('2024-11-01 12:45:00', 'Section-B02', 3.45, 6.00, CASE WHEN 3.45 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录21
('2024-11-01 13:00:00', 'Section-B02', 10.78, 6.00, CASE WHEN 10.78 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录22
('2024-11-01 13:15:00', 'Section-B02', 6.21, 6.00, CASE WHEN 6.21 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录23
('2024-11-01 13:30:00', 'Section-B02', 4.78, 6.00, CASE WHEN 4.78 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录24
('2024-11-01 13:45:00', 'Section-B02', 9.12, 6.00, CASE WHEN 9.12 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录25
('2024-11-01 14:00:00', 'Section-B02', 5.34, 6.00, CASE WHEN 5.34 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录26
('2024-11-01 14:15:00', 'Section-B02', 7.89, 6.00, CASE WHEN 7.89 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录27
('2024-11-01 14:30:00', 'Section-B02', 2.67, 6.00, CASE WHEN 2.67 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录28
('2024-11-01 14:45:00', 'Section-B02', 11.23, 6.00, CASE WHEN 11.23 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录29
('2024-11-01 15:00:00', 'Section-B02', 4.12, 6.00, CASE WHEN 4.12 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录30
('2024-11-01 15:15:00', 'Section-B02', 8.78, 6.00, CASE WHEN 8.78 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录31
('2024-11-01 15:30:00', 'Section-B02', 3.21, 6.00, CASE WHEN 3.21 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录32
('2024-11-01 15:45:00', 'Section-B02', 10.56, 6.00, CASE WHEN 10.56 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录33
('2024-11-01 16:00:00', 'Section-B02', 5.89, 6.00, CASE WHEN 5.89 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录34
('2024-11-01 16:15:00', 'Section-B02', 7.32, 6.00, CASE WHEN 7.32 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录35
('2024-11-01 16:30:00', 'Section-B02', 2.98, 6.00, CASE WHEN 2.98 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录36
('2024-11-01 16:45:00', 'Section-B02', 11.91, 6.00, CASE WHEN 11.91 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录37
('2024-11-01 17:00:00', 'Section-B02', 4.45, 6.00, CASE WHEN 4.45 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20'),
-- 数据记录38
('2024-11-01 17:15:00', 'Section-B02', 8.23, 6.00, CASE WHEN 8.23 >= 6.00 THEN 1 ELSE 0 END, 'PressureSensor-002', '2024-10-20');